#include <stdio.h>
// 查看你活了多少天！
int run(int x)
{
  if (x % 4 == 0 && x % 100 != 0 || x % 400 == 0)
    return 1;
  else
    return 0;
}
int main()
{
  int year1, year2, month1, month2, day1, day2, num = 0;
  printf("请输入你的出生年月日(用逗号分隔):");
  scanf("%d,%d,%d", &year1, &month1, &day1);
  printf("请输入今天的年月日(用逗号分隔):");
  scanf("%d,%d,%d", &year2, &month2, &day2);
  int n[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  // 判断
  if ((year2 - year1) > 1)
  {
    for (int i = year1 + 1; i <= year2 - 1; i++)
    {
      if (run(i) == 1)
        num += 366;
      else
        num += 365;
    }
  }
  // 判断
  if (run(year1) == 1)
    n[2] = 29;
  if (year1 == year2)
  {
    for (int j = month1 + 1; j < month2; j++)
      num += n[j];
    num = num + (n[month1] - day1) + day2;
  }
  // 重置数组
  n[2] = 28;
  // 判断
  if (year1 != year2)
  {
    if (run(year1) == 1)
      n[2] = 29;
    for (int k = month1 + 1; k <= 12; k++)
      num += n[k];
    num += (n[month1] - day1);
    // 重置数组
    n[2] = 28;
    if (run(year2) == 1)
      n[2] = 29;
    for (int h = month2 - 1; h >= 1; h--)
      num = num + n[h];
    num = num + day2;
  }
  printf("你已经活了 %d 天了！", num);
  return 0;
}